<%@ page contentType="text/html;charset=UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<c:set var="az" value="${pageContext.request.contextPath}" />
<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta charset="utf-8">
    <meta http-equiv="Pragma" content="no-cache">
    <meta http-equiv="Cache-Control" content="no-cache">
    <meta http-equiv="Expires" content="0">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>首页-框架页</title>

    <%@include file="/view/common/common-href.jsp" %>

    <style>

    </style>

</head>

<body>

<div class="form-box" style="padding-top:15px;">
    <div class="form-body">
        <form name="azeroth_form" id="azeroth_form" class="form form-horizontal" method="post"
            url="/sys/menuLeft/update?_m=exec">
            <input type="hidden" name="uid" id="uid" value="${obj.uid}" />

            <div class="form-group">
                <label class="col-sm-2 control-label">
                    <p class="label-txt">菜单名称：</p>
                    <p class="star">*</p>
                </label>
                <div class="col-sm-4">
                    <input id="funName" name="funName" value="${obj.funName}" class="form-control easyui-validatebox" style="width:100%;height:34px;line-height:34px;" required="required" validtype="length[1,20]" type="text">
                </div>

                <label class="col-sm-2 control-label">
                    <p class="label-txt">顶部菜单：</p>
                    <p class="star">*</p>
                </label>
                <div class="col-sm-4">
                    <input type="text" id="rootUid" name="rootUid" class="form-control easyui-combobox"
                           style="width:100%;height:34px;line-height:34px;"
                           data-options="
                                valueField: 'uid',
                                textField: 'funName',
                                panelHeight:'auto',
                                url:'/sys/menu/menuTree?_m=load&funType=top',
                                editable:false"
                           value="${obj.rootUid}" required="required" />
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label">
                    <p class="label-txt">图标ICON：</p>
                    <p class="star">*</p>
                </label>
                <div class="col-sm-4">
                    <input id="icon" name="icon" value="${obj.icon}" class="form-control easyui-validatebox" style="width:100%;height:34px;line-height:34px;" required="required" validtype="length[1,20]" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label">
                    <p class="label-txt">描述信息：</p>
                </label>
                <div class="col-sm-10">
                    <textarea id="remark" name="remark" value="${obj.remark}" class="form-control" validtype="length[0,50]"></textarea>
                </div>
            </div>

        </form>
    </div>
</div>

</body>

</html>
<script type="text/javascript">
    var $objData = {};
    var $azerothForm = $('#azeroth_form');

    $objData.submitForm = function($dialog, $gird) {
        $('#azeroth_form').submit();

        // 返回成功后，销毁弹出框、刷新列表
        $objData.sucess = function() {
            $gird.datagrid('reload');
            $dialog.dialog('destroy');
        }
    };

    $('#azeroth_form').form({
        url: $azerothForm.attr("url"),
        onSubmit:function(){
            if($(this).form('enableValidation').form('validate')){
                parent.$.messager.progress({ text : '正在处理，请稍后...' });
                return true;
            }else{
                return false;
            }
        },
        success:function(data) {
            parent.$.messager.alert("提示","保存成功！","info",function(){
                $objData.sucess();
            });

            parent.$.messager.progress('close');
        },
        error:function(){
            parent.$.messager.progress('close');
        }
    });

</script>